
public class WorldWar {
	public static ImageLoader imageLoader;
	public static MapLoader mapLoader;

	public static void main(String[] args) {
		// Load images
		imageLoader = new ImageLoader();
		mapLoader = new MapLoader();
		
		// Initialize models
		ModelFrameMain mFrameMain = new ModelFrameMain();
		ModelPanelGame mPanelGame = new ModelPanelGame();
		ModelPanelMenu mPanelMenu = new ModelPanelMenu();
		ModelPanelMapSelector mPanelMapSelector= new ModelPanelMapSelector();
		
		// Initialize controllers
		ControllerGame cGame = new ControllerGame();
		ControllerMenu cMenu = new ControllerMenu();
		
		// Initialize views
		ViewFrameMain vFrameMain = new ViewFrameMain();
		ViewPanelGame vPanelGame = new ViewPanelGame();
		ViewPanelMenu vPanelMenu = new ViewPanelMenu();
		ViewPanelMapSelector vPanelMapSelector = new ViewPanelMapSelector();
		
		// Add views to controllers
		cGame.addView(vFrameMain);
		cGame.addView(vPanelGame);
		
		cMenu.addView(vFrameMain);
		cMenu.addView(vPanelMenu);
		cMenu.addView(vPanelMapSelector);
		
		// Add models to controllers
		cGame.addModel(mPanelGame);
		cGame.addModel(mFrameMain);
		
		cMenu.addModel(mPanelMenu);
		cMenu.addModel(mPanelMapSelector);
		cMenu.addModel(mFrameMain);
		
		// Tell views who is the controller
		vPanelMenu.setController(cMenu);
		vPanelMapSelector.setController(cMenu);
		vPanelGame.setController(cGame);
		
		// Initialize		
		vFrameMain.addPanel(vPanelMenu.getPanel());
		vFrameMain.addPanel(vPanelMapSelector.getPanel());
		vFrameMain.addPanel(vPanelGame.getPanel());
		
		mFrameMain.setModelPanelMenu(mPanelMenu);
		mFrameMain.setModelPanelMapSelector(mPanelMapSelector);
		mFrameMain.setModelPanelGame(mPanelGame);
		
		mFrameMain.setPanelID(0);
	}
}
